<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
   <div id="app">
      <input type="text" v-model="val" />
       <h3>{{val|myCurrency}}</h3>
       <h3>{{val|reverse}}</h3>
   </div>
</body>
<script>
    //全局过滤器
    Vue.filter("reverse",function (value) {
       return value.split("").reverse().join("");
    });

    var app = new Vue({
        el:"#app",
        data:function () {
            return {
                val:""
            };
        },
        methods: {},
        //局部过滤器
        filters:{
            myCurrency:function (value) {
                return "￥"+value;
            }
        }
    });


</script>
</html>